package com.smile.f213;
import java.awt.BorderLayout;
import java.util.GregorianCalendar;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
public class SimpleTableDemo {
	public void createUI(){
		JFrame frame = new JFrame("列表框示例程序");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		String [] columnNames = {"编号","姓名","登记日期","专业","是否应届"};
		Object[][] data = {
				{new Integer(1),"李明",new GregorianCalendar(2008, 2, 3).getTime(),"计算机专业",new Boolean(false)},
				{new Integer(2),"张乐",new GregorianCalendar(2008, 5, 6).getTime(),"自动化专业",new Boolean(true)},
				{new Integer(3),"余名",new GregorianCalendar(2008, 9, 21).getTime(),"计算机专业",new Boolean(true)},
				{new Integer(4),"郭超",new GregorianCalendar(2008, 1, 3).getTime(),"金融专业",new Boolean(true)}
		};
		JTable table = new JTable(data, columnNames);
		JScrollPane scrollPane = new JScrollPane(table);
		frame.getContentPane().add(scrollPane,BorderLayout.CENTER);
		
		frame.setBounds(200, 200, 400, 120);
		frame.setVisible(true);
	}
	public static void main(String[] args) {
		SimpleTableDemo example = new SimpleTableDemo();
		example.createUI();
	}
}